<?php

/** libraries
 * http://docs.joomla.org/JToolBarHelper
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');

// import Joomla view library
jimport('joomla.application.component.view');

class bgViewbg extends JView
{
    protected $result;
    protected $pagination;
    
	// Overwriting JView display method
	function display($tpl = null) 
	{
        $model = $this->getModel();
       
        $task = &JRequest::getVar('task');
        
        switch($task){
            case 'detail':
                $id = JRequest::getVar('id');
                $id = is_array($id) ? $id[0] : $id;
                if($id){
                    $this->row = $model->load($id);
                }
                else{
                    die("データは見つかりませんでした");
                }
                $this->setLayout('detail');
            break;
            case 'center_club':
                $id = JRequest::getVar('id');
                $id = is_array($id) ? $id[0] : $id;
                $this->centerClub = $model->getCenterClub($id);
                if($id){
                    $this->row = $model->load($id);
                   
                }
                else{
                    die("データは見つかりませんでした");
                } 
                $this->setLayout('center_club');
            break;
            case 'tourism':
                $this->setLayout('tourism');
            break;
            case 'information':
                $id = JRequest::getVar('id');
                $id = is_array($id) ? $id[0] : $id;
                if($id){
                    $this->row = $model->load($id);
                }
                else{
                    die("データは見つかりませんでした");
                } 
                $this->setLayout('information');
            break;
            
            case 'icon':
                $this->setLayout('icon');
            break;
            
            default:
                //check button search
                $check = &JRequest::getVar('check');
                if($check == '1')
                {
                    $this->sr = '1';
                }
                $this->result = &$model->getTown();
                
                $this->setLayout('default');
                $this->pagination =& $this->get('Pagination');
        }
        
		parent::display();
	}
}




